<template>
    <div class="breadcrumb">{{breadcrumb}}</div>
</template>

<script>
export default {
    computed: {
        breadcrumb() {
            // 嵌套路由信息都在 this.$route.matched
            // 遍历获取每一个匹配到的组件得 meta 即可生成面包屑
            let res = '';
            this.$route.matched.forEach(element => {
                res += element.meta + '->';
            });
            console.log(res);
            
            return res
        }
    }

}
</script>

<style lang="less" scoped>
.breadcrumb {
    padding: 10px 0;
}
</style>